@extends('admin.common.layouts')

@section('style')
    <style>
        .abtn a{
            color:#fff;
            padding:15px;
            line-height:30px;
        }
        .abtn a:hover{
            color:#fff;
            text-decoration:none;
        }
    </style>
@show

@section('content')
  <div class="col-md-12">
    <div class="box">
      @include('admin.common.message')
    
      <!-- 栏目信息 -->
      <div class="box-header with-border">
        <h3 class="box-title">成绩查询</h3>
        <br><br>
        <div class="row">
          <form method="post" action="{{url('admin/sport/grade/search')}}" class="form-horizontal form-label-left" novalidate>
            <div class="col-xs-2">
              <input type="text" class="form-control" id="sportsmeeting" name="data[sportsmeeting]" placeholder="运动会">
            </div>
            <div class="col-xs-2">
              <input type="text" class="form-control" id="tournament" name="data[tournament]" placeholder="比赛项目">
            </div>
            <div class="col-xs-2">
              <input type="text" class="form-control" id="team" name="data[team]" placeholder="团队">
            </div>
            <div class="col-xs-2">
              <input type="text" class="form-control" id="athlete" name="data[athlete]" placeholder="运动员">
            </div>
            <button type="submit" class="btn btn-info" style="float:left;margin-right:15px;">查询</button>
          </form>
        </div>
      </div>

      <!-- 内容 -->
      
      <div class="box-body">
        <table class="table table-bordered">
          <tr>
            <th>运动会</th>
            <th>比赛项目</th>
            <th>团队</th>
            <th>运动员</th>
            <th>回合数</th>
            <th>计分方式</th>
            <th>成绩</th>
          </tr>
    

          @foreach($data as $vo)
            <tr>
              <td>{{$vo['sportsmeeting_name']}}</td>
              <td>{{$vo['tournament_name']}}</td>
              <td>{{$vo['team_name']}}</td>
              <td>{{$vo['athlete_name']}}</td>
              <td>{{$vo['round']}}</td>
              <td>{{$vo['category_name']}}</td>
              <td>{{$vo['grade']}}</td>
            </tr>
            
          @endforeach
        </table>
      </div>
      
    </div>
    <!-- /.box -->
  </div>

@endsection

@section('javascript')
<script>

    // function search(){
    //     // 获取input的数据，运动会名，项目名，团队名，运动员名
    //     var sportsmeeting = document.getElementById("sportsmeeting").value;
    //     var tournament = document.getElementById("tournament").value;
    //     var team = document.getElementById("team").value;
    //     var athlete = document.getElementById("athlete").value;
    //     var value = sportsmeeting+"_"+tournament+"_"+team+"_"+athlete;
    //     $.ajax({  
    //         url : "/admin/sport/grade/search/"+value,   //请求url  
    //         type : "get",  //请求类型  post|get  
    //         // data : sportsmeetingId, //后台用 request.getParameter("key");  
    //         dataType : "json",  //返回数据的 类型 text|json|html--  
    //         success : function(result){  //回调函数 和 后台返回的 数据  
    //             console.log();
    //             if(result.length>0){
    //                 // 将获取到的值循环赋值给比赛项目选项
    //                 for(var i=0; i<result.length; i++){  //通过遍历，创建行数据 
    //                     //添加选项"文本","值"  
                           
    //                 }
    //             }
                
    //             return result.length;
    //         }  
    //     });  
    // }
    
</script>
@show